#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_builtin_math() {
        assert_eq!(ffs(1), 0);
        assert_eq!(ffs(2), 1);
        assert_eq!(ffs(4), 2);
        assert_eq!(ffs(8), 3);
        assert_eq!(ffs(16), 4);
        assert_eq!(ffs(32), 5);

        // isfinite

        let pinf = 1.0 / 0.0;
        let ninf = -1.0 / 0.0;
        let fin = 1.0;

        assert_eq!(unsafe { isfinite(pinf) }, 0);
        assert_eq!(unsafe { isfinite(ninf) }, 0);
        assert_eq!(unsafe { isfinite(fin) }, 1);

        // isnan

        let nan = 0.0 / 0.0;
        let an = 1.0;

        assert_eq!(unsafe { isnan(nan) }, 1);
        assert_eq!(unsafe { isnan(an) }, 0);
    }
}